package com.wsoft.hr.pm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wsoft.bpm.bean.ApprovalChainNode;
import com.wsoft.bpm.query.mapping.ExtraBusinessDataQuery;
import com.wsoft.hr.pm.entity.HrPmProcessActivityEntity;
import com.wsoft.hr.pm.enums.HrProcessFlowStageEnum;
import com.wsoft.hr.pm.query.process.activity.HrPmProcessActivitySaveQuery;
import com.wsoft.hr.pm.vo.process.activity.HrPmProcessActivityDataVO;
import com.wsoft.hr.pm.vo.process.activity.ProcessActivityNodeVO;

import java.util.List;

/**
 * <p>
 * 活动考核流程主表 服务类
 * </p>
 *
 * @author zhonglj
 * @since 2025年02月28日 18:19:01
 */
public interface IHrPmProcessActivityService extends IService<HrPmProcessActivityEntity> {

    HrPmProcessActivityDataVO getByMemberTemplateId(Long memberTemplateId);

    void saveProcess(HrPmProcessActivitySaveQuery saveQuery);

    /**
     * 复制模版考评流程一份到活动考评流程
     *
     * @param templateId
     * @param memberTemplateId
     * @return boolean
     * @author zhonglj
     * @date 2025/3/1 13:51
     **/
    boolean copyTemplate(Long templateId, Long memberTemplateId);

    /**
     * 根据人员活动id、活动阶段获取动态审批链
     *
     * @param memberTemplateId
     * @param flowStage
     * @return java.util.List<com.wsoft.bpm.bean.ApprovalChainNode>
     * @author zhonglj
     * @date 2025/3/2 9:05
     **/
    List<ApprovalChainNode> getApprovalChainNodes(Long memberTemplateId, HrProcessFlowStageEnum flowStage);

    /**
     * 重置工作流审批链
     *
     * @param memberTemplateId
     * @param stageEnum
     * @return void
     * @author zhonglj
     * @date 2025/3/2 9:05
     **/
    void resetWorkFlowChain(Long memberTemplateId, HrProcessFlowStageEnum stageEnum);

    /**
     * 根据人员考核id-启动绩效评分工作流
     *
     * @param memberTemplateId  人员考核表id
     * @param stageEnum         所处阶段
     * @param extraBusinessData 额外的业务数据
     * @return java.lang.String
     * @author zhonglj
     * @date 2025/3/2 9:05
     **/
    String startProcess(Long memberTemplateId, HrProcessFlowStageEnum stageEnum, ExtraBusinessDataQuery extraBusinessData);

    /**
     * 根据businesskey获取动态审批链节点信息
     *
     * @param businessKey
     * @return com.wsoft.hr.pm.vo.process.activity.ProcessActivityNodeVO
     * @author zhonglj
     * @date 2025/3/5 11:17
     **/
    ProcessActivityNodeVO getProcessActivityNode(String businessKey);

    /**
     * 根据businesskey获取动态审批链节点信息
     *
     * @param businessKeyList
     * @return com.wsoft.hr.pm.vo.process.activity.ProcessActivityNodeVO
     * @author zhonglj
     * @date 2025/3/5 11:17
     **/
    List<ProcessActivityNodeVO> getProcessActivityNode(List<String> businessKeyList);
}
